package com.practice.springboot_01_zwj.scheduled;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class ScheduledTasks {
    @Autowired
    private FileImportService fileImportService;

    /**
     * 定时任务 - 每天早上7点执行
     */
    @Scheduled(cron = "0 0 7 * * ?")
    // @Scheduled(fixedRate = 500000) // 每500秒执行一次
    public void performTask() {
        fileImportService.executeFileImport();
    }

}